package sctu.edu.java.year2016.team01.renxinpeng.day20160530.chapter10_1;

import java.util.*;

/**
 * Created by Zero on 2016/5/30.
 * 将1~100之间的所有正整数存放在一个List集合中，并将集合中索引位置
 * 是10的对象从集合中移除。
 */

public class Storage {
    public static void main(String[] args) {


        List<Integer> list = new LinkedList<>();

        for (int i = 1; i < 101; i++)
            list.add(i);


        Iterator<Integer> storage = list.iterator();


        System.out.println("以前的集合是：");

        while (storage.hasNext()) {
            System.out.print(storage.next() + " ");
        }


            list.remove(10);



            Iterator<Integer> storage1 = list.iterator();


            System.out.println("");
            System.out.println("现在的集合是：");

            while (storage1.hasNext()) {
                System.out.print(storage1.next() + " ");
            }
        }
    }
